import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'extra_localizations.dart';

class ExtraLocalizationsDelegate extends LocalizationsDelegate<ExtraLocalizations> {
  const ExtraLocalizationsDelegate();

  @override
  bool isSupported(Locale locale) => ['en', 'zh'].contains(locale.languageCode);

  @override
  Future<ExtraLocalizations> load(Locale locale) {
    return SynchronousFuture<ExtraLocalizations>(ExtraLocalizations(locale));
  }

  @override
  bool shouldReload(ExtraLocalizationsDelegate old) => false;

  static ExtraLocalizationsDelegate delegate = const ExtraLocalizationsDelegate();
}